home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 17 / Hot Mix 17.iso / HM17_SGI / research / lib / live_image.pro < prev    next >
Text File  |  1997-07-08  |  2KB  |  85 lines

  1. ; $Id: live_image.pro,v 1.5 1997/04/16 20:20:58 billo Exp $
  2. ;
  3. ; Copyright (c) 1996-1997, Research Systems, Inc.  All rights reserved.
  4. ;       Unauthorized reproduction prohibited.
  5. ;
  6. ;+
  7. ; NAME:
  8. ;       LIVE_IMAGE
  9. ;
  10. ; PURPOSE:
  11. ;       Entry point to LIVE_IMAGE
  12. ;
  13. ; CALLING SEQUENCE:
  14. ;       LIVE_IMAGE, image
  15. ;
  16. ; OPTIONAL KEYWORDS:
  17. ;        RED=red                     ; Vector of red [optional]
  18. ;        GREEN=green                 ; Vector of green [optional]
  19. ;        BLUE=blue                   ; Vector of blue [optional]
  20. ;        STYLE=style                 ; A style name (string) [optional]
  21. ;        INDEXED_COLOR=indexedColor  ; Set to use indexed color [optional]
  22. ;
  23. ; DEVELOPMENT NOTES:
  24. ;        -
  25. ;
  26. ;------------------------------------------------------------------------------
  27. pro Live_Image, image, _EXTRA=extra
  28.  
  29.     ON_ERROR, 2
  30.  
  31.     WIDGET_CONTROL, /HOURGLASS
  32.  
  33.     ; Determine if the L_IMAGE routine has been resolved
  34.     ;
  35.     result = ROUTINE_INFO(/UNRESOLVED)
  36.  
  37.     void = WHERE(result eq 'L_IMAGE', count)
  38.  
  39.     ; If the L_IMAGE routine has not been resolved find insight.sav
  40.     ; and restore it.
  41.     ;
  42.     if (count ne 0) then begin
  43.  
  44.         ; Look for insight in its default location idlxx/lib/hook
  45.         ;
  46.         insightPath = FILEPATH('insight.sav', SUBDIR=['lib','hook'])
  47.         void = FINDFILE(insightPath, COUNT=count)
  48.  
  49.         ; If it wasn't found, notify the user.
  50.         ;
  51.         if (count eq 0) then begin
  52.  
  53.             result = DIALOG_MESSAGE($
  54.                 ['Insight was not found.',$
  55.                 'Please make sure insight.sav is in your hook directory', $
  56.                 'and !DIR points to your IDL directory.', $
  57.                 'Do you wish to locate insight.sav?'], /CANCEL)
  58.  
  59.             ; If they want to search for it, display std file dialog.
  60.             ;
  61.             if (result eq 'OK') then begin
  62.  
  63.                 insightPath = $
  64.                     DIALOG_PICKFILE(TITLE='PLease locate insight.sav', $
  65.                         /MUST_EXIST)
  66.  
  67.                 if (insightPath eq '') then $
  68.                     return
  69.  
  70.             endif else $
  71.                 return
  72.  
  73.         endif
  74.  
  75.         ; Restore L_IMAGE code
  76.         ;
  77.         restore, insightPath
  78.     endif
  79.  
  80.     ; Call L_IMAGE with passed in parameters
  81.     ;
  82.     L_IMAGE, image, _EXTRA=extra
  83.  
  84. end
  85.